package com.sike.netty.rumen.shizhan_rengong.common;

import java.util.*;

public class ServiceAnswerSet {
    private static Map<String, List<String>> answerMap = new HashMap<>();

    static {
        List<String> sikeList = new ArrayList<String>(){{
            add("死磕 Java 并发 ：https://www.skjava.com/series/1391296887813967872");
            add("死磕 Java 基础 ：https://www.skjava.com/series/1411518540095295488");
            add("死磕 Spring 之 IOC ：https://www.skjava.com/series/1391374860344758272");
            add("死磕 NIO ：https://www.skjava.com/series/1435619891100127232");
            add("死磕 Redis ：https://www.skjava.com/series/1391389927996002304");
            add("死磕 Netty ：https://www.skjava.com/series/");
        }};
        answerMap.put("1",sikeList);

        List<String> sikeNet = new ArrayList<String>(){{
            add("https://www.skjava.com");
            add("https://www.skjava.com/sike-java");
        }};
        answerMap.put("2",sikeNet);

        List<String> suggestList = new ArrayList<String>(){{
            add("请输入您的建议与反馈");
            add("您也可以登录这个地址进行反馈:https://www.skjava/suggest");
        }};
        answerMap.put("3",suggestList);
    }

    public static String getAnswer(String key) {
        List<String> list = answerMap.get(key);
        if (list == null || list.isEmpty()) {
            return "对不起，我不会这个问题";
        }

        return String.join("\r\n",list);
    }
}
